local HC = {}

-- 用于选武将牌的 interaction type ，和UI.ComboBox差不多，照着用就行
-- 必输参数：可选牌名choices；可输参数：全部牌名all_choices
-- For 役鬼
HC.GeneralCardNameBox = function(spec)
  spec.choices = type(spec.choices) == "table" and spec.choices or Util.DummyTable
  spec.all_choices = type(spec.all_choices) == "table" and spec.all_choices or spec.choices
  spec.default_choice = spec.default_choice and spec.default_choice or spec.choices[1]
  spec.type = "custom"
  spec.qml_path = "packages/new_hegcomplements/qml/SkillGeneralCardName"
  return spec
end

--获取从first后最近的满足skill_name的移动事件
HC.GetRecentMoveEventByskill = function (room, skill_name, first)
  local events = room.logic.event_recorder[GameEvent.MoveCards] or Util.DummyTable
  for i = first + 1, #events, 1 do
    local e = events[i]
    for _, move in ipairs(e.data) do
      if move.skillName == skill_name then
        return e
      end
    end
  end
  return nil
end

return HC
